package com.hy.exception;

/**
 * Created by chairal on 2017/6/24.
 */
public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private int code;

    public ServiceException(String message){
        super(message);
    }

    public ServiceException(int code, String message){
        super(message);
        this.code = code;
    }

    public ServiceException(ExceptionEnum exceptionEnum){
        this(exceptionEnum.getCode(), exceptionEnum.getMessage());
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
